
	$(document).ready(function () {
		//organ();
		//alert(123456789);
		//var levelnum = "${organ.levelnum}";
		//alert(levelnum);
		/* var ids = $("#departmentids").val();
		if(ids!="450b6074ebba40bfb09a1402dba096a8" && ids!="c4e27d6dbd1c42119b9f7d2edabbd118"){
			$("#DEPT").combobox({'readonly': true});//设置下拉框为禁用 
			$("#DEPT").combobox('setValue',ids);//菜单项可以text或者id
		} */

		$("#LSH").combobox({
			onChange: function (n,o) {
				$("#HPHM").textbox("clear");
				$("#SFZMHM").textbox("clear");
				searchCus();
			}
		});
		$("#HPHM").combobox({
			onChange: function (n,o) {
				$("#LSH").textbox("clear");
				$("#SFZMHM").textbox("clear");
				searchCus();
			}
		});
		$("#SFZMHM").combobox({
			onChange: function (n,o) {
				$("#HPHM").textbox("clear");
				$("#LSH").textbox("clear");
				searchCus();
			}
		});

		var SFZMHM=$('#SFZMHM').val();
		var LSH=$('#LSH').val();
		var HPHM=$('#HPHM').val();
		
		if(SFZMHM==''&&LSH==''&&HPHM==''){
			return false;
		}
		searchCus();
	});

//获取顾客信息
	function clearsj(){
		$("#ORGAN").textbox("clear");
		$("#BEGINTIME").textbox("clear");
		$("#ENDTIME").textbox("clear");
		$("#WFDM").textbox("clear");
		$("#CLLX").val('');
		$("#HPHM").textbox("clear");
		$("#LSH").textbox("clear");
		$("#SFZMHM").textbox("clear");
		$("#JNZT").val('');
	}
	
	
	//获取顾客信息
	function searchCus(){
		var SFZMHM=$('#SFZMHM').val();
		var LSH=$('#LSH').val();
		var HPHM=$('#HPHM').val();
		
		if(SFZMHM==''&&LSH==''&&HPHM==''){
			return false;
		}
		var url='/fineRegistration/getVInfo';
		var data={"sfzmhm":SFZMHM,"lsh":LSH,"hphm":HPHM};
		var reData = common_ajax.ajaxFunc(url,data,"json");
		if(reData.msg==200){
			$("#SFZMHM").textbox('setValue',reData.vehicle.sfzmhm);
			$("#LSH").textbox('setValue',reData.vehicle.lsh);
			$("#HPHM").textbox('setValue',reData.vehicle.hphm);
			$("#CLLX").val(reData.vehicle.cllx);
			return  reData;
		}
	}

	//格式化日期
	function myformatter(date) {
	    //获取年份
	    var y = date.getFullYear();
	    //获取月份
	    var m = date.getMonth() + 1;
	    return y + '-' + m;
	}
	
	//window.onload = function () {
	//alert(123456789);
	//var levelnum = "${organ.levelnum}";
	//alert(levelnum);
	//alert("${status}");
	/* var ids = $("#departmentids").val();
	if(ids!="450b6074ebba40bfb09a1402dba096a8" && ids!="c4e27d6dbd1c42119b9f7d2edabbd118"){
		$("#DEPT").combobox({'readonly': true});//设置下拉框为禁用 
		$("#DEPT").combobox('setValue',ids);//菜单项可以text或者id
	} */
//}
	
	var $form = $('#fineInfoStatisticFrom');
	function searchFrom(){
		initFineInfoTable();
	}
	var columns = [[
			  		{field:'vid',title:'vid',width:130,align:'center',hidden:true},
			  		{field:'ids',title:'ids',width:100,align:'center',hidden:true},
			  		{field:'hphm',title:'车牌号',width:80,align:'center'},
			  		{field:'cllx',title:'车辆类型',width:100,align:'center'},
			  		//{field:'lsh',title:'档案号',width:120,align:'center'},
			  		//{field:'sfzmhm',title:'身份证号',width:120,align:'center'},
			  		{field:'infractiondate',title:'违法时间',width:130,align:'center'},
			  		{field:'infractionplace',title:'违法地点',width:130,align:'center'},
			  		{field:'codecontent',title:'违法代码',width:200,align:'center'},
					{field:'punishment',title:'被处罚人',width:60,align:'center'},
					{field:'punishmentcontact',title:'联系方式',width:100,align:'center'},
					//{field:'pumoney',title:'罚款金额',width:50,align:'center'},
					//{field:'pumoneystatus',title:'缴纳状态',width:50,align:'center'},
					//{field:'qzcs',title:'行政强制措施',width:100,align:'center'},
					//{field:'sjwp',title:'收缴物品',width:100,align:'center'},
					//{field:'pudetails',title:'违法详情',width:150,align:'center'},
					//{field:'finepolice',title:'交通警察',width:60,align:'center'},
					//{field:'sdname',title:'部门',width:120,align:'center'},
					{field:'sdname',title:'机构',width:120,align:'center'},
					//{field:'creater',title:'创建人',width:50,align:'center'},
					//{field:'createdate',title:'创建时间',width:150,align:'center'},
					{field:'punote',title:'备注',width:200,align:'center'}
			      ]];
	function initFineInfoTable(){
		$('#fineInfoTable').datagrid({
			cls: "theme-datagrid",
			toolbar: '#tb',
			singleSelect: true,
			rownumbers: true, //显示序号
			pagination: true,
			pageSize: 10,
			url: "${cxt!}/fineQuery/querylist",
			queryParams: sy.serializeObject($form),
		    method: 'post',
			collapsible: true,
			remoteSort:false,
			multiSort:true,
			columns:columns,
			onLoadSuccess:function(){
				$('#fineInfoTable').datagrid("selectRow", 0);
				// 获取主表选中行
			},
			onClickRow:function(rowIndex,rowData){
			}
		});
	}
		